package shiyan;

import java.util.Scanner;

public class sy2 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        while (input.hasNext()) {
        	String s = input.nextLine();
        	int n = 0;
            int a = Integer.parseInt(s);
            int[] x = new int[String.valueOf(s).length()];
            String b = Integer.toBinaryString(a);
            String o = Integer.toOctalString(a);
            String h = Integer.toHexString(a);
            if(a>=10000 && a<=20000)
            	System.out.println(b+","+o+","+h);     	
            else{
            	if(a<0) a=a*(-1);
            	if(a==0) {x[0]=0;n=1;}
            	int sum=0;
            	while(a!=0){
            		int m=(int)a%10;
            		a=(int)a/10;
            		sum=sum+m;
            		x[n++]=m;
            	}
            	for(int i=n-1;i>=0;i--)
            		System.out.print(x[i]+" ");
            	System.out.println(sum);
            }
        }
    }
}
